﻿CREATE PROCEDURE [dbo].[WorkTime_Confirm]
	@WorkTimeId int,
	@TaskId int,
	@UserAccountId int,
	@EndTime datetime,
	@Note nvarchar(255)
AS
BEGIN
	Update WorkTime set EndTime = @EndTime, @Note = @Note, TotalSeconds = DATEDIFF(second, StartTime, @EndTime)
	where WorkTimeId = @WorkTimeId and TaskId = @TaskId and UserAccountId = @UserAccountId and EndTime is null
END